import React from 'react';
import { formatTime } from '@/utils/formatTime';
import Item from '@/pages/unitTest/components/Item';
import { shallow } from 'enzyme';

describe('Test testList render', () => {
    it('render Item dom', () => {
        const props = {
            time: {
                id: 0,
                timeMap: '1540612312',
            },
        };
        const wrapper = shallow(<Item {...props} />);
        console.log(wrapper.props());

        // 判断渲染的元素内容
        expect(
            wrapper
                .find('Fragment')
                .at(0)
                .text(),
        ).toBe(formatTime(props.time.timeMap));
    });
});
